package com.doufen.base.controller;

import com.doufen.base.dto.LoginDTO;
import com.doufen.common.result.Result;
import com.doufen.common.util.JwtUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/base/login")
public class LoginController {

    @PostMapping("/pwd")
    public Result<String> loginByPwd(@RequestBody LoginDTO dto) {
        // TODO 校验账号密码
        String token = JwtUtil.createToken(1001L, "USER");
        return Result.success(token);
    }
}
